package ma.zhiqiang.dataline.core.engine;

import ma.zhiqiang.dataline.core.dto.SourceRecord;

import java.util.Iterator;

public interface Source {
    /**
     * 1.读取源，后去迭代器对象
     * @return Iterator
     */
    Iterator read() throws Exception;

    /**
     * 2.将获取的对象转换成SourceRecord
     * @param record
     * @return SourceRecord
     */
    SourceRecord convert(Object record);

    /**
     * 3.关闭资源的方法
     */
    void close() throws Exception;
}
